package com.imooc.reader.utils;

import org.apache.commons.codec.digest.DigestUtils;

public class MD5Utils {
    public  static  String md5Digest(String source,Integer salt){
        //混淆源数据
        char[] chars = source.toCharArray();
        for (int i = 0; i < chars.length; i++) {
           chars[i] = (char)(chars[i]+salt);
        }
        //转换为String格式
        String target=new String(chars);
        String md5 = DigestUtils.md5Hex(target);
        return md5;
    }
}
